﻿<!DOCTYPE html>
<html>
<head>
	<title>物流信息</title>
	<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />

    <meta name="apple-mobile-web-app-capable" content="yes" />
	<link href="css/weui.min.css" rel="stylesheet" type="text/css" />
    <link href="css/iconfont.css" rel="stylesheet" type="text/css" />

	<script src="js/jquery.min.js"></script>
    <script src="js/weui.min.js"></script>
    <script src="js/utils.js"></script>

	<style type="text/css">
		html,body{width:100%;height:100%;padding:0px;margin:0 auto;box-sizing: border-box;font-family: Verdana;font-size: 12px;}
		div,input{box-sizing: border-box;}
	</style>
	<script type="text/javascript">
		var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?9e1a077ce4134c787bb4d3269e39ae53";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();

		$(document).ready(init);
		function init(){
			$("#codeInput").val(Utils.getURLParams('nu'));
			$("#codeInput").bind('keypress',function(event){  
	            if(event.keyCode == "13")      
	            {
					checkExpress();
	            }
	        });
checkExpress();
		}
		function checkExpress(){
			if($.trim($("#codeInput").val())=="")return;

			_hmt.push(["_trackEvent", "jybhy", "查询运单状态"]);
			$.ajax({
				url:"getkuaidi.php?nu="+$("#codeInput").val(),
				type:"get",
				dataType:"json",
				success:function(res){
					
					if(res.status==400){
						weui.alert("运单号错误");
					}else{
						console.log(res);

						var str="";

						// if(parseInt(res.ischeck)){
						// 	str="<div style='width:100%;text-align:center;'><span style='color:#fff;background:#00cc55;padding:5px 10px;border-radius:20px;font-size:24px;'>已签收</span></div>";
						// }

						for(var i=0;i<res.data.length;i++){
							str+="<div style='width:100%;padding:5px;border-top:2px solid #00cc55;margin-bottom:10px;'><div style='font-size:12px;color:#999;margin-bottom:5px;'>"+"<span style='color:#000;margin-right:4px;font-weight:bold;'>["+Utils.getTimeDistance(res.data[i].time)+"]</span>"+res.data[i].time+"</div><div>"+res.data[i].context+"</div></div>";
						}

						$("#expressDataContent").html(str);
					}
				}
			});
		}
	</script>
</head>
<body>
	<div style="width:100%;height:100%;padding:10px;">
		<div style="margin-top: 20px;position: relative;">
			<span class='iconfont icon-search' style="position:absolute;right: 12px;top:7px;"></span>
			<input id='codeInput' type="text" name="" placeholder="输入运单号查询" style=" outline: none;width:100%;height:40px;line-height: 40px;padding: 0px 10px;border-radius: 20px;border:1px solid #999;" />
		</div>
		<div onclick="checkExpress();" style="margin-top: 20px;width:100%;height:40px;line-height: 40px;border-radius:20px;text-align: center;background: #ff3366;color: #fff;font-size:14px;">查询此运单状态</div>
		<div id='expressDataContent' style="margin-top: 20px;"></div>
	</div>
</body>
</html>